<?php

require_once('alipay_function.php');
class alipay_user_service {
var $gateway;
var $_key;
var $mysign;
var $sign_type;
var $parameter;
var $_input_charset;
function alipay_user_service($parameter,$key,$sign_type) {
$this->gateway	      = 'https://www.alipay.com/cooperate/gateway.do?';
$this->_key  = $key;
$this->sign_type      = $sign_type;
$this->parameter      = para_filter($parameter);
if($parameter['_input_charset'] == '')
$this->parameter['_input_charset'] = 'utf-8';
$this->_input_charset   = $this->parameter['_input_charset'];
$sort_array   = arg_sort($this->parameter);
$this->mysign = build_mysign($sort_array,$this->_key,$this->sign_type);
}
function build_form($icon) {
$url = $this->gateway.'_input_charset='.$this->parameter['_input_charset'];
while (list ($key,$val) = each ($this->parameter)) {
$url.='&'.$key.'='.$val;
}
$url.='&sign='.$this->mysign;
$url.='&sign_type='.$this->sign_type;
$sHtml = "<a href='".$url."'><img src='".$icon."' alt='支付宝快捷登录' /></a>";
return $sHtml;
}
}

?>